package impl.sdi.business.classes;

import com.sdi.business.exception.EntityNotFoundException;
import com.sdi.infrastructure.Factories;
import com.sdi.model.User;
import com.sdi.persistence.UserDao;

public class UsersBuscar {

	public User find(String nick) throws EntityNotFoundException {
		UserDao dao = Factories.persistence.createUserDao();
		User u = dao.findByNick(nick);
		if ( u == null) {
			throw new EntityNotFoundException("No se ha encontrado el usuario");
		}
		
		return u;
	}

}
